﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.geom {
    import flash.geom.*;

    public class IntRectangle {

        public var x:int = 0;
        public var y:int = 0;
        public var width:int = 0;
        public var height:int = 0;

        public function IntRectangle(_arg1:int=0, _arg2:int=0, _arg3:int=0, _arg4:int=0){
            this.setRectXYWH(_arg1, _arg2, _arg3, _arg4);
        }
        public static function creatWithRectangle(_arg1:Rectangle):IntRectangle{
            return (new IntRectangle(_arg1.x, _arg1.y, _arg1.width, _arg1.height));
        }

        public function toRectangle():Rectangle{
            return (new Rectangle(this.x, this.y, this.width, this.height));
        }
        public function setWithRectangle(_arg1:Rectangle):void{
            this.x = _arg1.x;
            this.y = _arg1.y;
            this.width = _arg1.width;
            this.height = _arg1.height;
        }
        public function setRect(_arg1:IntRectangle):void{
            this.setRectXYWH(_arg1.x, _arg1.y, _arg1.width, _arg1.height);
        }
        public function setRectXYWH(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
            this.x = _arg1;
            this.y = _arg2;
            this.width = _arg3;
            this.height = _arg4;
        }
        public function setLocation(_arg1:IntPoint):void{
            this.x = _arg1.x;
            this.y = _arg1.y;
        }
        public function setSize(_arg1:IntDimension):void{
            this.width = _arg1.width;
            this.height = _arg1.height;
        }
        public function getSize():IntDimension{
            return (new IntDimension(this.width, this.height));
        }
        public function getLocation():IntPoint{
            return (new IntPoint(this.x, this.y));
        }
        public function union(_arg1:IntRectangle):IntRectangle{
            var _local2:int = Math.min(this.x, _arg1.x);
            var _local3:int = Math.max((this.x + this.width), (_arg1.x + _arg1.width));
            var _local4:int = Math.min(this.y, _arg1.y);
            var _local5:int = Math.max((this.y + this.height), (_arg1.y + _arg1.height));
            return (new IntRectangle(_local2, _local4, (_local3 - _local2), (_local5 - _local4)));
        }
        public function grow(_arg1:int, _arg2:int):void{
            this.x = (this.x - _arg1);
            this.y = (this.y - _arg2);
            this.width = (this.width + (_arg1 * 2));
            this.height = (this.height + (_arg2 * 2));
        }
        public function move(_arg1:int, _arg2:int):void{
            this.x = (this.x + _arg1);
            this.y = (this.y + _arg2);
        }
        public function resize(_arg1:int=0, _arg2:int=0):void{
            this.width = (this.width + _arg1);
            this.height = (this.height + _arg2);
        }
        public function leftTop():IntPoint{
            return (new IntPoint(this.x, this.y));
        }
        public function rightTop():IntPoint{
            return (new IntPoint((this.x + this.width), this.y));
        }
        public function leftBottom():IntPoint{
            return (new IntPoint(this.x, (this.y + this.height)));
        }
        public function rightBottom():IntPoint{
            return (new IntPoint((this.x + this.width), (this.y + this.height)));
        }
        public function containsPoint(_arg1:IntPoint):Boolean{
            if ((((((((_arg1.x < this.x)) || ((_arg1.y < this.y)))) || ((_arg1.x > (this.x + this.width))))) || ((_arg1.y > (this.y + this.height))))){
                return (false);
            };
            return (true);
        }
        public function equals(_arg1:Object):Boolean{
            var _local2:IntRectangle = (_arg1 as IntRectangle);
            if (_local2 == null){
                return (false);
            };
            return ((((((((this.x === _local2.x)) && ((this.y === _local2.y)))) && ((this.width === _local2.width)))) && ((this.height === _local2.height))));
        }
        public function clone():IntRectangle{
            return (new IntRectangle(this.x, this.y, this.width, this.height));
        }
        public function toString():String{
            return ((((((((("IntRectangle[x:" + this.x) + ",y:") + this.y) + ", width:") + this.width) + ",height:") + this.height) + "]"));
        }

    }
}//package org.aswing.geom 
